﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAWSharp.FileFormats.WavFile.Entities
{
    public class FileHeader
    {
        public char[] fileChunkID { get; set; }
        public int fileChunkSize { get; set; }
        public char[] format { get; set; }

        public override string ToString()
        {
            return (string.Format(@"ChunkId: {0}
                                    Chunk Size: {1}
                                    Format: {2}"
                    , new string(fileChunkID)
                    , fileChunkSize.ToString()
                    , new string(format)));
        }

        public bool IsValid()
        {
            if (!(new string(fileChunkID) == "RIFF"))
                return false;

            if (!(new string(format) == "WAVE"))
                return false;

            return true;
        }

    }
}
